import { createRouter, createWebHistory } from 'vue-router'
import Home from '../components/Home.vue'  
import Products from '../components/Products.vue'
import Cart from '../components/Cart.vue'

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/home',
    redirect: '/'
  },
  {
    path: '/products',
    name: 'Products',
    component: Products
  },
  {
    path: '/cart',
    name: 'Cart',
    component: Cart
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../components/About.vue')
  },
  {
    path: '/contact',
    name: 'Contact',
    component: () => import('../components/Contact.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router